#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Niklas Hauser
#
# This file is part of the modm project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# -----------------------------------------------------------------------------


def init(module):
    module.name = ":driver:hmc58x"
    module.description = """\
# HMC58x3 3-Axis Digital Magnetometer

The HMC58x3 is a surface-mount, multi-chip module designed for low-field
magnetic sensing with a digital interface for applications such as
low-cost compassing and magnetometry. The HMC58x3 includes high-resolution
magneto-resistive sensors plus an ASIC containing amplification,
automatic degaussing strap drivers, offset cancellation, and a 12-bit
ADC that enables 1-2 degrees compass heading accuracy.
"""

def prepare(module, options):
    module.depends(
        ":architecture:i2c.device",
        ":architecture:register",
        ":math:utils")
    return True

def build(env):
    env.outbasepath = "modm/src/modm/driver/inertial"
    env.copy("hmc5843.hpp")
    env.copy("hmc5883l.hpp")
    env.copy("hmc58x3.hpp")
    env.copy("hmc58x3_impl.hpp")
